package h_factory.c_method;

/**
 * Created by wug on 2016/7/12 0012.
 */
public abstract class WeaponFactory {
    private WeaponFactory weaponFactory = null;

    protected abstract Weapon makeWeapon(WeaponEnum weaponEnum);


    /**
     * 原本想要通过该方法来处理各个工厂的关系
     * 但是这样就会失去WeaponFactory的抽象性
     * 这样就需要通过另一个类来管理整个关系，所以
     */
    /*
    public Weapon getWeapon(WeaponEnum weaponEnum) {
        if (weaponEnum.getType() == 2) {
            weaponFactory = new WeaponBladeFactory();
        } else {
            weaponFactory = new WeaponSwordFactory();
        }
        return weaponFactory.makeWeapon(weaponEnum);
    }
    */
}
